﻿using System.Web.Security;
using System.Windows.Forms;
using RedRiver.Framework.XtraCommon.UserAuthentication;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Web.ClientServices.Providers;

namespace RedRiver.Framework.XtraCommon.Test
{
    
    
    /// <summary>
    ///这是 TestClientFormsLogin 的测试类，旨在
    ///包含所有 TestClientFormsLogin 单元测试
    ///</summary>
    [TestClass()]
    public class TestClientFormsLogin
    {


        private TestContext testContextInstance;

        /// <summary>
        ///获取或设置测试上下文，上下文提供
        ///有关当前测试运行及其功能的信息。
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region 附加测试特性
        // 
        //编写测试时，还可使用以下特性:
        //
        //使用 ClassInitialize 在运行类中的第一个测试前先运行代码
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //使用 ClassCleanup 在运行完类中的所有测试后再运行代码
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //使用 TestInitialize 在运行每个测试前先运行代码
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //使用 TestCleanup 在运行完每个测试后运行代码
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion

        [TestMethod()]
        public void TestMembershipLogin(){
            //var result = Membership.ValidateUser("tianxiufeng", "txf_1975");
            //MessageBox.Show(result.ToString());
            //var provider = Membership.Providers[0];
            var result = Membership.ValidateUser("EP000001", "okqqtNUgL5ld3bnM1I/dCg==");
            MessageBox.Show(result.ToString());
        }

        /// <summary>
        ///ClientFormsLogin 构造函数 的测试
        ///</summary>
        [TestMethod()]
        public void TestClientFormsLoginConstructor()
        {
            ClientFormsLogin target = new ClientFormsLogin();
            Assert.Inconclusive("TODO: 实现用来验证目标的代码");
        }

        /// <summary>
        ///Application_ApplicationExit 的测试
        ///</summary>
        [TestMethod()]
        [DeploymentItem("RedRiver.Framework.XtraCommon.dll")]
        public void TestApplication_ApplicationExit()
        {
            object sender = null; // TODO: 初始化为适当的值
            EventArgs e = null; // TODO: 初始化为适当的值
            ClientFormsLogin_Accessor.Application_ApplicationExit(sender, e);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }

        /// <summary>
        ///ClientFormsLogin_UserValidated 的测试
        ///</summary>
        [TestMethod()]
        [DeploymentItem("RedRiver.Framework.XtraCommon.dll")]
        public void TestClientFormsLogin_UserValidated()
        {
            object sender = null; // TODO: 初始化为适当的值
            UserValidatedEventArgs e = null; // TODO: 初始化为适当的值
            ClientFormsLogin_Accessor.ClientFormsLogin_UserValidated(sender, e);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }

        /// <summary>
        ///Dispose 的测试
        ///</summary>
        [TestMethod()]
        [DeploymentItem("RedRiver.Framework.XtraCommon.dll")]
        public void TestDispose()
        {
            ClientFormsLogin_Accessor target = new ClientFormsLogin_Accessor(); // TODO: 初始化为适当的值
            bool disposing = false; // TODO: 初始化为适当的值
            target.Dispose(disposing);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }

        /// <summary>
        ///GetCredentials 的测试
        ///</summary>
        [TestMethod()]
        public void TestGetCredentials()
        {
            ClientFormsLogin target = new ClientFormsLogin(); // TODO: 初始化为适当的值
            ClientFormsAuthenticationCredentials expected = null; // TODO: 初始化为适当的值
            ClientFormsAuthenticationCredentials actual;
            actual = target.GetCredentials();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///InitializeComponent 的测试
        ///</summary>
        [TestMethod()]
        [DeploymentItem("RedRiver.Framework.XtraCommon.dll")]
        public void TestInitializeComponent()
        {
            ClientFormsLogin_Accessor target = new ClientFormsLogin_Accessor(); // TODO: 初始化为适当的值
            target.InitializeComponent();
            Assert.Inconclusive("无法验证不返回值的方法。");
        }

        /// <summary>
        ///ProcessLogin 的测试
        ///</summary>
        [TestMethod()]
        [DeploymentItem("RedRiver.Framework.XtraCommon.dll")]
        public void TestProcessLogin()
        {
            ClientFormsLogin_Accessor target = new ClientFormsLogin_Accessor(); // TODO: 初始化为适当的值
            string userName = string.Empty; // TODO: 初始化为适当的值
            string password = string.Empty; // TODO: 初始化为适当的值
            bool expected = false; // TODO: 初始化为适当的值
            bool actual;
            actual = target.ProcessLogin(userName, password);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///SetInternetCookie 的测试
        ///</summary>
        [TestMethod()]
        [DeploymentItem("RedRiver.Framework.XtraCommon.dll")]
        public void TestSetInternetCookie()
        {
            string serviceUri = string.Empty; // TODO: 初始化为适当的值
            ClientFormsLogin_Accessor.SetInternetCookie(serviceUri);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
    }
}
